{{****************************************************************************}}
{{* CDR plugin template                                                      *}}
{{* Author   : Benoit Frigon                                                 *}}
{{* Last mod : 1 oct 2012                                                    *}}
{{*                                                                          *}}
{{*                                                                          *}}
{{****************************************************************************}}
<form id="cdr_frm_filters" action="" method="get">
	<div class="box toolbar">
		<ul id="toolbar_cdr">
			<li class="text">Find :</li>
			<input type="hidden" name="path" value="{{$tab_path}}" />
			<li><input name="s" type="text" id="cdr_txtsearch" style="width: 150px;" value="{{$_GET['s']|if_empty|""}}" /></li>
			<li><button name="action" value="search" type="submit" title="Search"><img alt="Search" src="images/blank.png" class="icon16-search" /></button></li>	
			<li><a title="Clear search results" href="?path={{$tab_path}}"><img alt="Clear" src="images/blank.png" class="icon16-clear" /></a></li>

			<li class="separator">&nbsp;</li>

			<li id="refresh"><a class="refresh" href="?path={{$tab_path}}&page={{$page}}&{{$uri_query}}"><img src="images/blank.png" class="icon16-reload" />Refresh</a></li>

			<li class="separator">&nbsp;</li>
			<li class="{{is|"$page<=1"|disabled}}" title="First page" id="first_page"><a href="?path={{$tab_path}}&page=1&{{$uri_query}}"><img alt="First page" src="images/blank.png" class="icon16-first" /></a></li>
			<li class="{{is|"$page<=1"|disabled}}" title="Previous page" id="prev_page"><a href="?path={{$tab_path}}&page={{$prev_page}}&{{$uri_query}}"><img alt="Prev. page" src="images/blank.png" class="icon16-prev" /></a></li>
			<li class="dropdown" id="page" style=""><a title="Page {{$page}} of {{$last_page}}" href="#">Page {{$page}}</a>
				<img class="close-dropdown" src="images/blank.png" alt="" />
				<ul>
				{{foreach|$pages}}
					<li><a href="?path={{$tab_path}}&page={{row}}">Page {{row}}</a></li>
				{{/foreach}}
				</ul>
			</li>
			<li class="{{is|"$page>=$last_page"|disabled}}" title="Next page" id="next_page"><a href="?path={{$tab_path}}&page={{$next_page}}&{{$uri_query}}"><img alt="Next page" src="images/blank.png" class="icon16-next" /></a></li>
			<li class="{{is|"$page>=$last_page"|disabled}}" title="Last page" id="last_page"><a href="?path={{$tab_path}}&page={{$last_page}}&{{$uri_query}}"><img alt="Last page" src="images/blank.png" class="icon16-last" /></a></li>
			<li class="separator"></li>
			<li class="dropdown" id="page"><a title="Results per page" href="#">{{$max_results}}<img alt=". Results per page" src="images/blank.png" class="icon16-number" /></a>
				<img class="close-dropdown" src="images/blank.png" alt="" />
				<ul>
					<li><a href="?path={{$tab_path}}&{{$uri_query}}&page={{$page}}&max=10">10</a></li>
					<li><a href="?path={{$tab_path}}&{{$uri_query}}&page={{$page}}&max=25">25</a></li>
					<li><a href="?path={{$tab_path}}&{{$uri_query}}&page={{$page}}&max=50">50</a></li>
				</ul>
			</li>
		</ul>
		<div class="clear"></div>

	</div>

	<table class="grid expand">
		<tr>
			<th class="column-icon"></th>
			<th>Date</th>
			<th>From</th>
			<th>Name</th>
			<th>Destination</th>
			<th>Duration</th>
			<th>Billed sec.</th>
			<th>Cost</th>
			<th>Disposition</th>
		</tr>
		{{resultset|$results}}
			{{column|clid|regex|"|(?:\"(.*)\")?\s*<?([\d\*#]*)>?|"|$clid|$clid_name|$clid_number}} 
	
			<tr class="{{altern|cdr|alt}}">
				<td><img alt="{{column|type}}" class="icon16-{{column|type}}" src="images/blank.png" /></td>
				<td>{{column|calldate|format_date}}</td>
				<td>{{$clid_name|if_empty|"Unknown"|lower|ucwords}}</td>
				<td>
					{{$clid_number|is_phonenumber}}
						<a href="?path=ReverseLookup.tools.rlookup&number={{$clid_number}}">{{$clid_number|if_empty|"Unknown"|format_phone}}</a>
					{{else}}
						{{$clid_number|if_empty|"Unknown"|format_phone}}
					{{end}}
				</td>
				<td>
					{{column|dst|is_phonenumber}}
						<a href="?path=ReverseLookup.tools.rlookup&number={{column|dst}}">{{column|dst|format_phone}}</a>
					{{else}}
						{{column|dst|format_phone}}
					{{end}}
				</td>
				<td>{{column|duration|format_seconds}}</td>
				<td>{{column|billsec|format_seconds}}</td>
				<td>{{column|cost|format_money}}</td>
				<td>{{column|disposition|lower|ucfirst}}</td>
			</tr>
		{{/resultset}}
		<tr>
			<th class="column-icon"></th>
			<th></th>
			<th></th>
			<th></th>
			<th></th>
			<th>{{$total_duration|format_seconds}}</th>
			<th>{{$total_billsec|format_seconds}}</th>
			<th>{{$total_cost|format_money}}</th>
			<th></th>
		</tr>
	</table>
</form>
<p class="v_spacing">{{$total_calls}} result(s) found. (Page {{$page}} of {{$last_page}})</p>

